const _products = [{
  type: 1,
  id: 1,
  name: 'vivo X20Plus全面屏手机',
  inventory: 1000,
  desc: '面部识别 后置双摄 光学防抖',
  price: 3489,
  imgUrl: require('../assets/products/phone1.jpg')
},
{
  type: 1,
  id: 2,
  name: '美图M8s',
  inventory: 2001,
  desc: '四大动漫联名 限量自拍神器',
  price: 1888,
  imgUrl: require('../assets/products/phone2.png')
},
{
  type: 1,
  id: 3,
  name: 'Nokia/诺基亚 7',
  inventory: 50,
  desc: '10月24日 10:07 新品抢购',
  price: 3666,
  imgUrl: require('../assets/products/phone3.jpg')
},
{
  type: 1,
  id: 4,
  name: '华为Mate10',
  inventory: 2000,
  desc: 'AI芯片智慧识屏 徕卡双摄 1.6大光圈',
  price: 2661,
  imgUrl: require('../assets/products/phone4.png')
},
{
  type: 2,
  id: 5,
  name: 'Five Plus2017新品',
  inventory: 5,
  desc: '新品女冬装潮压纹漆皮半身高腰短裙皮裙2JM3074070 ',
  price: 266,
  imgUrl: require('../assets/products/fz1.jpg')
},
{
  type: 2,
  id: 6,
  name: 'ochirly欧时力',
  inventory: 46,
  desc: '2017新女秋装PU金属环高腰A字短裙半身裙1JJ4071570',
  price: 199,
  imgUrl: require('../assets/products/fz2.jpg')
},
{
  type: 2,
  id: 7,
  name: '女士短裙',
  inventory: 3,
  desc: '秋装新款女装韩版半身裙秋装潮流气质职业装短裙时尚A字女裙',
  price: 88,
  imgUrl: require('../assets/products/fz3.jpg')
},
{
  type: 2,
  id: 8,
  name: '纯色毛衣裙',
  inventory: 80,
  desc: '半高领针织连衣裙秋冬纯色毛衣裙宽松七分袖打底长裙中长款羊毛衫',
  price: 166,
  imgUrl: require('../assets/products/fz4.jpg')
},
{
  type: 3,
  id: 9,
  name: '新鲜牛肉',
  inventory: 5000,
  desc: '伊赛西门塔尔牛腩块500g新鲜牛肉冷冻生鲜',
  price: 25.8,
  imgUrl: require('../assets/products/sx1.jpg')
},
{
  type: 3,
  id: 10,
  name: '新西兰冰鲜帝王鲑',
  inventory: 1999,
  desc: '新鲜三文鱼刺身生鱼片 进口海鲜生鲜  默认切片 200g净肉 不鲜即退 ',
  price: 50,
  imgUrl: require('../assets/products/sx2.jpg')
},
{
  type: 3,
  id: 11,
  name: '波士顿龙虾',
  inventory: 2000,
  desc: '净重400g-500g 熟冻生鲜新鲜火锅食材',
  price: 80.5,
  imgUrl: require('../assets/products/sx3.jpg')
},
{
  type: 4,
  id: 12,
  name: '全套10册成长励志系列',
  inventory: 122,
  desc: '爸妈不是我的佣人 小学生课外阅读书籍 五四一二三年级课外书必读儿童读物7-8-10-12-15岁4-5-6年级故事书籍',
  price: 188,
  imgUrl: require('../assets/products/book.jpg')
},
{
  type: 4,
  id: 13,
  name: '大冰的书全套4册',
  inventory: 200,
  desc: '我不+好吗好的+乖摸摸头+阿弥陀佛么么哒',
  price: 200,
  imgUrl: require('../assets/products/book2.jpg')
}
]

export default {
  getProducts (cb) {
    setTimeout(() => cb(_products), 2000)
  },
  buyProducts (products, cb, errcb) {
    setTimeout(() => {
      (Math.random() > 0.5) ? cb() : errcb()
    }, 300)
  }
}
